// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.


suite("test_cast_to_decimal128i_38_37_from_str") {

    // This test case is generated from the correspoinding be UT test case,
    // update this case if the correspoinding be UT test case is updated,
    // e.g.: ../run-be-ut.sh --run --filter=FunctionCastToDecimalTest.* --gen_regression_case
    sql "drop table if exists test_cast_to_decimal128i_38_37_from_str_22_nullable;"
    sql "create table test_cast_to_decimal128i_38_37_from_str_22_nullable(f1 int, f2 string) properties('replication_num'='1');"
    sql """insert into test_cast_to_decimal128i_38_37_from_str_22_nullable values (0, "0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e2147483647"),(1, "-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e2147483647"),(2, "0"),(3, "1"),(4, "8"),(5, "9"),(6, "0."),(7, "1."),(8, "8."),(9, "9."),(10, "-0"),(11, "-1"),(12, "-8"),(13, "-9"),(14, "-0."),(15, "-1."),(16, "-8."),(17, "-9."),(18, ".00000000000000000000000000000000000004"),(19, ".00000000000000000000000000000000000014"),
      (20, ".00000000000000000000000000000000000094"),(21, ".09999999999999999999999999999999999994"),(22, ".90000000000000000000000000000000000004"),(23, ".90000000000000000000000000000000000014"),(24, ".99999999999999999999999999999999999984"),(25, ".99999999999999999999999999999999999994"),(26, ".00000000000000000000000000000000000005"),(27, ".00000000000000000000000000000000000015"),(28, ".00000000000000000000000000000000000095"),(29, ".09999999999999999999999999999999999995"),(30, ".90000000000000000000000000000000000005"),(31, ".90000000000000000000000000000000000015"),(32, ".99999999999999999999999999999999999985"),(33, ".99999999999999999999999999999999999994"),(34, "-.00000000000000000000000000000000000004"),(35, "-.00000000000000000000000000000000000014"),(36, "-.00000000000000000000000000000000000094"),(37, "-.09999999999999999999999999999999999994"),(38, "-.90000000000000000000000000000000000004"),(39, "-.90000000000000000000000000000000000014"),
      (40, "-.99999999999999999999999999999999999984"),(41, "-.99999999999999999999999999999999999994"),(42, "-.00000000000000000000000000000000000005"),(43, "-.00000000000000000000000000000000000015"),(44, "-.00000000000000000000000000000000000095"),(45, "-.09999999999999999999999999999999999995"),(46, "-.90000000000000000000000000000000000005"),(47, "-.90000000000000000000000000000000000015"),(48, "-.99999999999999999999999999999999999985"),(49, "-.99999999999999999999999999999999999994"),(50, "00000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(51, "00000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(52, "00000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(53, "00999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(54, "09000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(55, "09000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(56, "09999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(57, "09999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(58, "10000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(59, "10000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),
      (60, "10000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(61, "10999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(62, "19000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(63, "19000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(64, "19999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(65, "19999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(66, "80000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(67, "80000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(68, "80000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(69, "80999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(70, "89000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(71, "89000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(72, "89999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(73, "89999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(74, "90000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(75, "90000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(76, "90000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(77, "90999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(78, "99000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(79, "99000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),
      (80, "99999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(81, "99999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(82, "00000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(83, "00000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(84, "00000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(85, "00999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(86, "09000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(87, "09000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(88, "09999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(89, "09999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(90, "10000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(91, "10000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(92, "10000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(93, "10999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(94, "19000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(95, "19000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(96, "19999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(97, "19999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(98, "80000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(99, "80000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),
      (100, "80000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(101, "80999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(102, "89000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(103, "89000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(104, "89999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(105, "89999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(106, "90000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(107, "90000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(108, "90000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(109, "90999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(110, "99000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(111, "99000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(112, "99999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(113, "99999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(114, "-00000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(115, "-00000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(116, "-00000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(117, "-00999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(118, "-09000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(119, "-09000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),
      (120, "-09999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(121, "-09999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(122, "-10000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(123, "-10000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(124, "-10000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(125, "-10999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(126, "-19000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(127, "-19000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(128, "-19999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(129, "-19999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(130, "-80000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(131, "-80000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(132, "-80000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(133, "-80999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(134, "-89000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(135, "-89000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(136, "-89999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(137, "-89999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(138, "-90000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(139, "-90000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),
      (140, "-90000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(141, "-90999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(142, "-99000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(143, "-99000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(144, "-99999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(145, "-99999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(146, "-00000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(147, "-00000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(148, "-00000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(149, "-00999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(150, "-09000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(151, "-09000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(152, "-09999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(153, "-09999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(154, "-10000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(155, "-10000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(156, "-10000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(157, "-10999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(158, "-19000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(159, "-19000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),
      (160, "-19999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(161, "-19999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(162, "-80000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(163, "-80000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(164, "-80000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(165, "-80999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(166, "-89000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(167, "-89000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(168, "-89999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(169, "-89999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(170, "-90000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(171, "-90000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(172, "-90000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(173, "-90999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(174, "-99000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(175, "-99000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(176, "-99999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(177, "-99999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100")
      ,(178, null);
    """

    sql "set enable_strict_cast=true;"
    qt_sql_22_strict 'select f1, cast(f2 as decimalv3(38, 37)) from test_cast_to_decimal128i_38_37_from_str_22_nullable order by 1;'

    sql "set enable_strict_cast=false;"
    qt_sql_22_non_strict 'select f1, cast(f2 as decimalv3(38, 37)) from test_cast_to_decimal128i_38_37_from_str_22_nullable order by 1;'

    sql "drop table if exists test_cast_to_decimal128i_38_37_from_str_22_not_nullable;"
    sql "create table test_cast_to_decimal128i_38_37_from_str_22_not_nullable(f1 int, f2 string) properties('replication_num'='1');"
    sql """insert into test_cast_to_decimal128i_38_37_from_str_22_not_nullable values (0, "0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e2147483647"),(1, "-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e2147483647"),(2, "0"),(3, "1"),(4, "8"),(5, "9"),(6, "0."),(7, "1."),(8, "8."),(9, "9."),(10, "-0"),(11, "-1"),(12, "-8"),(13, "-9"),(14, "-0."),(15, "-1."),(16, "-8."),(17, "-9."),(18, ".00000000000000000000000000000000000004"),(19, ".00000000000000000000000000000000000014"),
      (20, ".00000000000000000000000000000000000094"),(21, ".09999999999999999999999999999999999994"),(22, ".90000000000000000000000000000000000004"),(23, ".90000000000000000000000000000000000014"),(24, ".99999999999999999999999999999999999984"),(25, ".99999999999999999999999999999999999994"),(26, ".00000000000000000000000000000000000005"),(27, ".00000000000000000000000000000000000015"),(28, ".00000000000000000000000000000000000095"),(29, ".09999999999999999999999999999999999995"),(30, ".90000000000000000000000000000000000005"),(31, ".90000000000000000000000000000000000015"),(32, ".99999999999999999999999999999999999985"),(33, ".99999999999999999999999999999999999994"),(34, "-.00000000000000000000000000000000000004"),(35, "-.00000000000000000000000000000000000014"),(36, "-.00000000000000000000000000000000000094"),(37, "-.09999999999999999999999999999999999994"),(38, "-.90000000000000000000000000000000000004"),(39, "-.90000000000000000000000000000000000014"),
      (40, "-.99999999999999999999999999999999999984"),(41, "-.99999999999999999999999999999999999994"),(42, "-.00000000000000000000000000000000000005"),(43, "-.00000000000000000000000000000000000015"),(44, "-.00000000000000000000000000000000000095"),(45, "-.09999999999999999999999999999999999995"),(46, "-.90000000000000000000000000000000000005"),(47, "-.90000000000000000000000000000000000015"),(48, "-.99999999999999999999999999999999999985"),(49, "-.99999999999999999999999999999999999994"),(50, "00000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(51, "00000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(52, "00000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(53, "00999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(54, "09000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(55, "09000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(56, "09999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(57, "09999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(58, "10000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(59, "10000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),
      (60, "10000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(61, "10999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(62, "19000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(63, "19000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(64, "19999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(65, "19999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(66, "80000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(67, "80000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(68, "80000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(69, "80999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(70, "89000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(71, "89000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(72, "89999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(73, "89999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(74, "90000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(75, "90000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(76, "90000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(77, "90999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(78, "99000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(79, "99000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),
      (80, "99999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(81, "99999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(82, "00000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(83, "00000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(84, "00000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(85, "00999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(86, "09000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(87, "09000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(88, "09999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(89, "09999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(90, "10000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(91, "10000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(92, "10000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(93, "10999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(94, "19000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(95, "19000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(96, "19999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(97, "19999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(98, "80000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(99, "80000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),
      (100, "80000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(101, "80999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(102, "89000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(103, "89000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(104, "89999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(105, "89999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(106, "90000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(107, "90000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(108, "90000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(109, "90999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(110, "99000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(111, "99000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(112, "99999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(113, "99999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(114, "-00000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(115, "-00000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(116, "-00000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(117, "-00999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(118, "-09000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(119, "-09000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),
      (120, "-09999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(121, "-09999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(122, "-10000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(123, "-10000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(124, "-10000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(125, "-10999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(126, "-19000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(127, "-19000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(128, "-19999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(129, "-19999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(130, "-80000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(131, "-80000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(132, "-80000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(133, "-80999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(134, "-89000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(135, "-89000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(136, "-89999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(137, "-89999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(138, "-90000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(139, "-90000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),
      (140, "-90000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(141, "-90999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(142, "-99000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(143, "-99000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(144, "-99999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(145, "-99999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(146, "-00000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(147, "-00000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(148, "-00000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(149, "-00999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(150, "-09000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(151, "-09000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(152, "-09999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(153, "-09999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(154, "-10000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(155, "-10000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(156, "-10000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(157, "-10999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(158, "-19000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(159, "-19000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),
      (160, "-19999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(161, "-19999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(162, "-80000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(163, "-80000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(164, "-80000000000000000000000000000000000009500000000000000000000000000000000000000000000000000000000000000.e-100"),(165, "-80999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(166, "-89000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000.e-100"),(167, "-89000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000.e-100"),(168, "-89999999999999999999999999999999999998500000000000000000000000000000000000000000000000000000000000000.e-100"),(169, "-89999999999999999999999999999999999999500000000000000000000000000000000000000000000000000000000000000.e-100"),(170, "-90000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(171, "-90000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(172, "-90000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000.e-100"),(173, "-90999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100"),(174, "-99000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000.e-100"),(175, "-99000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000.e-100"),(176, "-99999999999999999999999999999999999998400000000000000000000000000000000000000000000000000000000000000.e-100"),(177, "-99999999999999999999999999999999999999400000000000000000000000000000000000000000000000000000000000000.e-100");
    """

    sql "set enable_strict_cast=true;"
    qt_sql_22_strict 'select f1, cast(f2 as decimalv3(38, 37)) from test_cast_to_decimal128i_38_37_from_str_22_not_nullable order by 1;'

    sql "set enable_strict_cast=false;"
    qt_sql_22_non_strict 'select f1, cast(f2 as decimalv3(38, 37)) from test_cast_to_decimal128i_38_37_from_str_22_not_nullable order by 1;'

}